<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加分类阶元</title>
<!--#include virtual="users.inc.asp"-->
</head>

<body>
<%
if not chkadmin() then
	response.Write("你没有权限修改资料！</body></html>")
	response.End()
end if
if request.Form("Submit")<>"" then
	set conn=server.createobject("adodb.connection")
	conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("App_Data\MainDB.mdb")
	set rs=server.createobject("adodb.recordset")
	rs.open "SELECT * FROM [Taxon]",conn,3,3
	rs.addnew
	rs("Name")=request.Form("TName")
	rs("ChineseName")=request.Form("TChineseName")
	rs("UpperTaxonID")=CInt(request.Form("TUpperTaxonID"))
	rs("Intro")=request.Form("TIntro")
	rs.update
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
end if
%>
<form id="form1" name="form1" method="post" action="addtaxon.asp">
	<label for="TName">分类阶元学名：</label>
	<input type="text" name="TName" id="TName" />
	<br />
	<label for="TChineseName">分类阶元中文名：</label>
	<input type="text" name="TChineseName" id="TChineseName" />
	<br />
	<label for="TUpperTaxonID">所属阶元ID：</label>
	<input type="text" name="TUpperTaxonID" id="TUpperTaxonID" />
	<br />
	<label for="TIntro">分类阶元简介</label>
	<textarea name="TIntro" id="TIntro" cols="45" rows="5"></textarea>
	<br />
	<input type="submit" name="Submit" id="Submit" value="提交" />
</form>
<%
Dim iTaxonID(100)
Dim iChineseName(100)
Dim iUpperTaxonID(100)

sub printer(p)
	Dim i
	for each i in iTaxonID
		if i<>0 and iUpperTaxonID(i)=p then
			response.Write("<li>" & iChineseName(i) & "(ID=" & i & ")<ul>")
			printer CInt(iTaxonID(i))
			response.Write("</ul></li>")
		end if
	next
end sub

set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("App_Data\MainDB.mdb")
set rs=server.createobject("adodb.recordset")
rs.open "SELECT * FROM [Taxon]",conn,3,3
while not rs.eof
	i=Cint(rs("TaxonID"))
	iTaxonID(i)=i
	iChineseName(i)=rs("ChineseName")
	iUpperTaxonID(i)=rs("UpperTaxonID")
	rs.movenext
	'response.Write(iTaxonID(i) & iChineseName(i) & iUpperTaxonID(i))
wend
rs.close
set rs=nothing
conn.close
set conn=nothing

num=i
response.Write("<ul>")
printer(0)
response.Write("</ul>")
%>
</body>
</html>
